home *** CD-ROM | disk | FTP | other *** search
/ Popular Request / By Popular Request (Arsenal Computer)(SysOptics Distribution System).ISO / amiga4 / timer.lha / Timer.Doc < prev    next >
Encoding:
Text File  |  1994-01-30  |  2.5 KB  |  85 lines

  1.  
  2.    NAME
  3.     Timer -- Measure the execution time of a CLI program (V37)
  4.  
  5.    SYNOPSIS
  6.     Timer command_line_to_execute
  7.  
  8.    FUNCTION
  9.     Timer measures the time a CLI program takes to do it's job. It uses
  10.     the timer.device GetSysTime() function before and after running the
  11.     program by calling to the dos.library System() function, and then
  12.     prints the difference between the two times.
  13.  
  14.     The program executed by Timer inherits it's stack size. Other
  15.     parameters retain their default value as set by System().
  16.  
  17.    INPUTS
  18.     command_line_to_execute - A normal command line, for example 'Copy
  19.        DH0: RAM: all quiet'.
  20.  
  21.    RESULT
  22.     '*** Time: %ld.%06ld secs'
  23.  
  24.     Timer passes to the shell the return code of the executed program.
  25.  
  26.    NOTES
  27.     Experimentation shows that Timer's timings are accurate down to about
  28.     1/50th of a second.
  29.  
  30.     You might want to redirect Timer's output, your program's output, or
  31.     both. The 2.0 shell interprets a redirection command such as '>T:tmp'
  32.     no matter where it is on the command line, so something like
  33.  
  34.         Timer Dir >T:tmp
  35.  
  36.     would result in Timer's AND Dir's output going to T:tmp. To redirect
  37.     Dir to T:tmp and retain Timer's output on the shell, which was
  38.     probably what you meant, you should do
  39.  
  40.         Timer >* Dir >T:tmp
  41.  
  42.     (in other words, redirect Timer to the shell window). Obviously,
  43.     reversing the file names reverses the effect.
  44.  
  45.    EXAMPLES
  46.     These examples show Timer's and OS's overhead on a 68000 Amiga under
  47.     Kickstart 39.106:
  48.  
  49.         > Timer
  50.         *** Time: 0.199686 secs
  51.         > Timer NOP
  52.         *** Time: 0.254926 secs
  53.     [NOP is a silly program that simply clears D0 and RTS's]
  54.         > Timer Wait 5
  55.         *** Time: 5.373808 secs
  56.         > Timer Wait 10
  57.         *** Time: 10.478978 secs
  58.         > Timer Wait 50
  59.         *** Time: 50.365576 secs
  60.  
  61.    DISTRIBUTION
  62.     This program is freeware. You may redistribute it as long as:
  63.      - this text and the source code are included;
  64.      - you don't charge more than a nominal copying fee for distribution.
  65.  
  66.     Please state your modifications to the code with a clear comment, and
  67.     send me your modified version. It would be a good idea to include
  68.     the original code, anyway.
  69.  
  70.     Any contribution will be greatly appreciated (I'm a poor engineering
  71.     student, you know).
  72.  
  73.    DISCLAIMER
  74.     The author does not assume any responsibility for damages which could
  75.     result by the use of this program. The entire risk for the use of
  76.     this program is assumed by the user.
  77.  
  78.    AUTHOR
  79.     Flavio Stanchina
  80.     Loc. Montevaccino, 39
  81.     38040 Trento (Italia)
  82.  
  83.     email: 2:333/408.9@fidonet.org
  84.  
  85.